package w3

object TestMAp {
  def main(args: Array[String]): Unit = {
    var m = Map("dog" -> 11, "pig" -> 7, "beef" -> 34)
    println("----迭代-----------")
    println(m)
    for (x <- m.keys)
      println(x + "->" + m(x))
    println("方式2：")
    for ((x, y) <- m) {
      println(x + "->" + y)
    }
  }

}
